home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / PictUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.0 KB  |  144 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Tuesday, September 17, 1991 at 3:35 PM
  5.  PictUtil.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1990-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __PICTUTIL__
  16. #define __PICTUTIL__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __PALETTES__
  23. #include <Palettes.h>
  24. #endif
  25.  
  26.  
  27. enum {
  28.  
  29.  
  30. /* verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls */
  31.  
  32. #define returnColorTable ((short) 0x0001)
  33. #define returnPalette ((short) 0x0002)
  34. #define recordComments ((short) 0x0004)
  35. #define recordFontInfo ((short) 0x0008)
  36. #define suppressBlackAndWhite ((short) 0x0010)
  37.  
  38. /* color pick methods */
  39.  
  40.  systemMethod = 0,                    /*system color pick method*/
  41.  popularMethod = 1,                    /*method that chooses the most popular set of colors*/
  42.  medianMethod = 2,                    /*method that chooses a good average mix of colors*/
  43.  
  44. /* color bank types */
  45.  ColorBankIsCustom = -1,
  46.  ColorBankIsExactAnd555 = 0,
  47.  ColorBankIs555 = 1
  48. };
  49.  
  50. typedef long PictInfoID;
  51.  
  52. struct CommentSpec {
  53.  short count;                        /* number of occurrances of this comment ID */
  54.  short ID;                            /* ID for the comment in the picture */
  55. };
  56.  
  57. typedef struct CommentSpec CommentSpec;
  58. typedef CommentSpec *CommentSpecPtr, **CommentSpecHandle;
  59.  
  60. struct FontSpec {
  61.  short pictFontID;                    /* ID of the font in the picture */
  62.  short sysFontID;                    /* ID of the same font in the current system file */
  63.  long size[4];                        /* bit array of all the sizes found (1..127) (bit 0 means > 127) */
  64.  short style;                        /* combined style of all occurrances of the font */
  65.  long nameOffset;                    /* offset into the fontNamesHdl handle for the font’s name */
  66. };
  67.  
  68. typedef struct FontSpec FontSpec;
  69. typedef FontSpec *FontSpecPtr, **FontSpecHandle;
  70.  
  71. struct PictInfo {
  72.  short version;                        /* this is always zero, for now */
  73.  long uniqueColors;                    /* the number of actual colors in the picture(s)/pixmap(s) */
  74.  PaletteHandle thePalette;            /* handle to the palette information */
  75.  CTabHandle theColorTable;            /* handle to the color table */
  76.  Fixed hRes;                        /* maximum horizontal resolution for all the pixmaps */
  77.  Fixed vRes;                        /* maximum vertical resolution for all the pixmaps */
  78.  short depth;                        /* maximum depth for all the pixmaps (in the picture) */
  79.  Rect sourceRect;                    /* the picture frame rectangle (this contains the entire picture) */
  80.  long textCount;                    /* total number of text strings in the picture */
  81.  long lineCount;                    /* total number of lines in the picture */
  82.  long rectCount;                    /* total number of rectangles in the picture */
  83.  long rRectCount;                    /* total number of round rectangles in the picture */
  84.  long ovalCount;                    /* total number of ovals in the picture */
  85.  long arcCount;                        /* total number of arcs in the picture */
  86.  long polyCount;                    /* total number of polygons in the picture */
  87.  long regionCount;                    /* total number of regions in the picture */
  88.  long bitMapCount;                    /* total number of bitmaps in the picture */
  89.  long pixMapCount;                    /* total number of pixmaps in the picture */
  90.  long commentCount;                    /* total number of comments in the picture */
  91.  long uniqueComments;                /* the number of unique comments in the picture */
  92.  CommentSpecHandle commentHandle;    /* handle to all the comment information */
  93.  long uniqueFonts;                    /* the number of unique fonts in the picture */
  94.  FontSpecHandle fontHandle;            /* handle to the FontSpec information */
  95.  Handle fontNamesHandle;            /* handle to the font names */
  96.  long reserved1;
  97.  long reserved2;
  98. };
  99.  
  100. typedef struct PictInfo PictInfo;
  101. typedef PictInfo *PictInfoPtr, **PictInfoHandle;
  102.  
  103.  
  104. #ifdef __cplusplus
  105. extern "C" {
  106. #endif
  107. pascal OSErr GetPictInfo(PicHandle thePictHandle,
  108.                          PictInfo *thePictInfo,
  109.                          short verb,
  110.                          short colorsRequested,
  111.                          short colorPickMethod,
  112.                          short version)
  113.  = {0x303C,0x0800,0xA831}; 
  114. pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle,
  115.                            PictInfo *thePictInfo,
  116.                            short verb,
  117.                            short colorsRequested,
  118.                            short colorPickMethod,
  119.                            short version)
  120.  = {0x303C,0x0801,0xA831}; 
  121. pascal OSErr NewPictInfo(PictInfoID *thePictInfoID,
  122.                          short verb,
  123.                          short colorsRequested,
  124.                          short colorPickMethod,
  125.                          short version)
  126.  = {0x303C,0x0602,0xA831}; 
  127. pascal OSErr RecordPictInfo(PictInfoID thePictInfoID,
  128.                             PicHandle thePictHandle)
  129.  = {0x303C,0x0403,0xA831}; 
  130. pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID,
  131.                               PixMapHandle thePixMapHandle)
  132.  = {0x303C,0x0404,0xA831}; 
  133. pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID,
  134.                               PictInfo *thePictInfo,
  135.                               short colorsRequested)
  136.  = {0x303C,0x0505,0xA831}; 
  137. pascal OSErr DisposPictInfo(PictInfoID thePictInfoID)
  138.  = {0x303C,0x0206,0xA831}; 
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142.  
  143. #endif
  144.